package com.day2.demo;

import java.util.Random;

public class Demo4 {
	public static void main(String[] args) {
		String num=GetSevenNum();
		System.out.println("随机生成的后7位为："+num);
	}
	
	public static String GetSevenNum() {
		Random rd=new Random();
		int arr[]=new int[7];
		String num = "";
		for (int i = 0; i < arr.length; i++) {
			arr[i]=rd.nextInt(10);
			if (i==3) {
				num += arr[i]+" ";
			}else {
				num += arr[i];
			}
		}
		return num;
	}
}
